<template>
    <div id="modify">
       <navbar title="修改密码"/>
	   <div class="content">
		   <van-cell-group>
			   <van-field
				  type="password"
				  v-show="downIcon"
				  placeholder="新密码"
				  @click-right-icon="eye"
				  right-icon="eye"
				  v-model="password"
				  error-message
			  />
			  <van-field
				  type="text"
				  v-show="!downIcon"
				  placeholder="新密码"
				  @click-right-icon="eye"
				  right-icon="eye-o"
				  v-model="password"
				  error-message
			  />
			  <van-field
				  type="password"
				  v-show="downIcons"
				  placeholder="请再次输入新密码"
				  @click-right-icon="eyes"
				  right-icon="eye"
				  v-model="passwords"
				  error-message
			  />
			  <van-field
				  type="text"
				  v-show="!downIcons"
				  placeholder="请再次输入新密码"
				  @click-right-icon="eyes"
				  right-icon="eye-o"
				  v-model="passwords"
				  error-message
			  />
		   </van-cell-group>
		   <van-button type="primary" block @click='gonext()' :disabled="password!=''&&passwords!=''?false:true">确定修改</van-button>
	   </div>
    </div>
</template>
<script>
	import Vue from 'vue';
		import { Field,Toast } from 'vant';
		Vue.use(Field).use(Toast);
 import navbar from "../../components/navbar.vue"
   export default {
 		name:'Modify',
       components :{
           navbar 
       },
        data() {
            return {
				password:'',
				passwords:'',
                downIcon:true, 
                downIcons:true, 
            }
        },
        created() {
            
        },
        
        methods: {
           eye() {
				  this.downIcon = !this.downIcon;
			  },
		  eyes() {
		  				  this.downIcons = !this.downIcons;
		  			  },
		  buton(){
			  if(this.password==this.passwords){
				  Toast.loading({
				    message: '修改成功...',
				    forbidClick: true,
				    loadingType: 'spinner',
				  });
				  this.$router.push({
				            name: 'home',
				            
				          })
			  }else{
				   Toast.fail('两次密码输入不正确');
			  }
		  }
        },
        watch: {
        }
    };
</script>
<style lang="scss" scoped>
	.van-button--block {
	    display: block;
	    width: 100%;
	    margin: 40px auto 20px;
	    border-radius: 4px;
	    font-size: 16px;
	    background: #FF854D;
	    border: 1px solid #ff854d;
	}


</style>
